package org.example.designPattern.factoryPattern1.factory;


import org.example.designPattern.factoryPattern1.service.Car;
import org.example.designPattern.factoryPattern1.service.impl.AoDi;
import org.example.designPattern.factoryPattern1.service.impl.Bmw;

public class CarFactory {
    public static Car createCar(String name) {
        if ("".equals(name)) {
            return null;
        }
        if (name.equals("奥迪")) {
            return new AoDi();
        }
        if (name.equals("宝马")) {
            return new Bmw();
        }
        return null;
    }



}